home *** CD-ROM | disk | FTP | other *** search
- Path: info.uah.edu!oreo!gbacon
- From: gbacon@oreo (Greg Bacon)
- Newsgroups: comp.lang.c
- Subject: Re: Strcat Doesn't work for this?
- Date: 13 Jan 1996 01:26:40 GMT
- Organization: The University of Alabama in Huntsville
- Message-ID: <4d71og$88a@info.uah.edu>
- References: <Pine.SOL.3.91.960111151925.25068C-100000@lore.cs.purdue.edu>
- NNTP-Posting-Host: oreo.aspire.cs.uah.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- ** Craig Cook ** (cookca@cs.purdue.edu) wrote:
- : Here is my excerpt of code in question:
-
-
- : Putword(int w, char *imageChar)
- : {
- : w = (w & 0xff);
- : strcat( imageChar, (const char *)w );
-
- : }
-
- : Why does it core dump? It should work right?
-
- : Craig
- : ,,,
- : (o o)
- : -------------=={{ cookca@.cs.purdue.edu}}==-----------ooO-(_)-Ooo-------
-
- There have been other suggestions, but is there enough storage allocated
- at the end of your imageChar array to hold the extra 4 (I'm assuming
- UNIX here) chars? If not, that would cause a segmentation violation
- and, in turn, a core dump.
-
- Greg
- --
- Greg Bacon <gbacon@cs.uah.edu>
- University of Alabama in Huntsville
- CS Department Systems Support Team
-